home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1276 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  792 b 

  1. Path: axe.netdoor.com!news
  2. From: esargent@netdoor.com (Eric Sargent)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Strcat Doesn't work for this?
  5. Date: Fri, 12 Jan 1996 20:29:27 GMT
  6. Organization: Internet Doorway, Inc.
  7. Message-ID: <4d6g8d$ouq@axe.netdoor.com>
  8. References: <Pine.SOL.3.91.960111151925.25068C-100000@lore.cs.purdue.edu>
  9. NNTP-Posting-Host: port91.netdoor.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. ** Craig Cook ** <cookca@cs.purdue.edu> wrote:
  13.  
  14. >Putword(int w, char *imageChar)
  15. >{
  16. >        w = (w & 0xff);
  17. >        strcat( imageChar, (const char *)w );
  18.  
  19. >}
  20.  
  21.     Looks as though you are passing a pointer with a range of 0-255, where
  22. you want to pass a pointer that points to w.  Try:
  23.  
  24. strcat(imageChar, (const char *)&w);
  25.  
  26.     Cast the address of w to char *, not cast value of w to char *.
  27.  
  28.  
  29.  
  30.